{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
	<form class="layui-form p-4">
		<h3 class="pb-3">新建订单</h3>
		<table class="layui-table layui-table-form">
			<tr><td class="layui-td-gray-2">用户ID<font>*</font></td>
			<td><input type="text" name="uid"  lay-verify="required" lay-reqText="请完善用户ID" value="" autocomplete="off" placeholder="请输入用户ID" class="layui-input"></td><td class="layui-td-gray-2">设备ID<font>*</font></td>
			<td><input type="text" name="device_id"  lay-verify="required" lay-reqText="请完善设备ID" value="" autocomplete="off" placeholder="请输入设备ID" class="layui-input"></td><td class="layui-td-gray-2">购酒量(ml)<font>*</font></td>
			<td><input type="text" name="wine_num"  lay-verify="required" lay-reqText="请完善购酒量(ml)" value="" autocomplete="off" placeholder="请输入购酒量(ml)" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">订单号<font>*</font></td>
			<td><input type="text" name="order_no"  lay-verify="required" lay-reqText="请完善订单号" value="" autocomplete="off" placeholder="请输入订单号" class="layui-input"></td><td class="layui-td-gray-2">实付金额<font>*</font></td>
			<td><input type="text" name="amount"  lay-verify="required" lay-reqText="请完善实付金额" value="" autocomplete="off" placeholder="请输入实付金额" class="layui-input"></td><td class="layui-td-gray-2">设备地址<font>*</font></td>
			<td><input type="text" name="address"  lay-verify="required" lay-reqText="请完善设备地址" value="" autocomplete="off" placeholder="请输入设备地址" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">状态:0待支付 1已支付<font>*</font></td>
			<td><input type="text" name="status"  lay-verify="required" lay-reqText="请完善状态:0待支付 1已支付" value="" autocomplete="off" placeholder="请输入状态:0待支付 1已支付" class="layui-input"></td><td class="layui-td-gray-2">支付方式:1微信 2积分 3兑酒券<font>*</font></td>
			<td><input type="text" name="pay_type"  lay-verify="required" lay-reqText="请完善支付方式:1微信 2积分 3兑酒券" value="" autocomplete="off" placeholder="请输入支付方式:1微信 2积分 3兑酒券" class="layui-input"></td><td class="layui-td-gray-2">支付状态;0-待支付;1-已支付;2-已退款;3-拒绝退款<font>*</font></td>
			<td><input type="text" name="pay_status"  lay-verify="required" lay-reqText="请完善支付状态;0-待支付;1-已支付;2-已退款;3-拒绝退款" value="" autocomplete="off" placeholder="请输入支付状态;0-待支付;1-已支付;2-已退款;3-拒绝退款" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">创建时间<font>*</font></td>
			<td><input type="text" name="create_time"  lay-verify="required" lay-reqText="请完善创建时间" value="" autocomplete="off" placeholder="请输入创建时间" class="layui-input"></td><td class="layui-td-gray-2">编辑时间<font>*</font></td>
			<td><input type="text" name="update_time"  lay-verify="required" lay-reqText="请完善编辑时间" value="" autocomplete="off" placeholder="请输入编辑时间" class="layui-input"></td><td colspan='2'></td>
		</tr>
		</table>
		<div class="pt-3">
			<input type="hidden" name="id" value="0"/>
			<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
	<script>
		var moduleInit = ['tool'];

			function gouguInit() {
			var form = layui.form, tool = layui.tool;
			var layer = layui.layer;
			var element = layui.element;
			
			
			
			//监听提交
			form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
			layer.msg(e.msg);
			if (e.code == 0) {
			tool.sideClose(1000);
		}
		}
			tool.post("/admin/order/add", data.field, callback);
			return false;
		});
		}

	</script>
{/block}
<!-- /脚本 -->